#include "mytest.h"
#include <QDebug>

DUKGLUE_EXTERNAL_REGISTER(MyStructTest)
{
    DUKGLUE_REGISTER_CONSTRUCTOR(ctx,MyStructTest);
    DUKGLUE_REGISTER_CONSTRUCTOR(ctx,MyStructTest,int,std::string);
    DUKGLUE_REGISTER_PROPERTY(ctx, MyStructTest, getValue, setValue, "value");
    DUKGLUE_REGISTER_PROPERTY(ctx, MyStructTest, getName, setName, "name");
}

DUKGLUE_EXTERNAL_REGISTER(MyTest)
{
    DUKGLUE_REGISTER_CLASS(ctx, MyTest,std::string);
    DUKGLUE_REGISTER_METHOD(ctx, MyTest, print, "print");
    DUKGLUE_REGISTER_METHOD(ctx, MyTest, print2, "print2");
    DUKGLUE_REGISTER_METHOD(ctx, MyTest, getName, "getName");
}

MyTest::MyTest(std::string name)
    : mname(name)
{

}

MyTest::~MyTest()
{
    qDebug()<<"MyTest deleteed.";
}

std::string MyTest::getName(void)
{
    return mname;
}

void MyTest::print2(std::string text)
{
    qDebug()<<text.c_str();
}

void MyTest::print(void)
{
    qDebug()<<mname.c_str();
}

